SAP
SAP JCO Trace
To perform a deeper analysis of SAP, follow these steps:
-
Set the two options
-Djco.trace_level=<trace_level>and-Djco.trace_path=<directory_of_trace_files>in the designer start script for Tomcat. -
Files with the signature
JCO*.trcare created in the directory specified bydirectory_of_trace_files. The volume of protocol data can be adjusted by changing the trace level. The additional logging activated for specific trace levels is detailed below. SAP recommends using trace level 5 for error diagnostics. -
If the property
jco.trace_pathis not set, the trace output will be written to the console.
SAP JCo Trace Level Overview
| Level | Trace Content |
|---|---|
| 0 | No trace |
| 1 | JCo version and runtime environment info + important public API calls |
| 2 | + Additional public API calls (e.g., getClient and releaseClient) |
| 3 | + Internal middleware calls (JNI / JRfc layer) |
| 4 | + More internal middleware details (e.g., enter/leave API info) |
| 5 | + Record memory allocation info + important caller stack trace info (e.g., for removePool, setTraceLevel) |
| 6 | + RFC meta data (name, type, offset, length, import/export options) + ASCII content data (first 1000 chars of structs / first 5 rows of tables) |
| 7 | + Additional hex values for content data |
| 8 | + Full content data dump (no character or row limit) |
| 9 | + Java to/from C marshalling field data and code page converter calls |
| 10 | + Memory leak analysis info (record ObjectIDs & detailed freeRecord) |
Level 4 will generate an output similar to the following:
JCoServerThread-4 [18:12:17:617]: [JCoAPI] JCoServer dispatching (BAPI_CUSTOMER_SEARCH) on handle [4] before getCallHandler()
JCoServerThread-4 [18:12:17:617]: [JCoAPI] JCoServer dispatching (BAPI_CUSTOMER_SEARCH) on handle [4] after getCallHandler(), factory is emds.epi.impl.adapter.sap.rfc.channel.RfcFunctionHandler
JCoServerThread-4 [18:12:17:617]: [JCoAPI] JCoServer [function model] before handleRequest (BAPI_CUSTOMER_SEARCH) on handle [4]
JCoServerThread-4 [18:12:17:722]: [JCoAPI] JCoServer [function model] after handleRequest (BAPI_CUSTOMER_SEARCH) on handle [4] returns after 106 ms
This output is sufficient for logging the times and calls.